﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/default.Master" AutoEventWireup="true"
    CodeBehind="Farmer-List.aspx.cs" Inherits="NRCP.Farmer_List" %>
<%@ Import Namespace="NRCP.Helpers" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="Scripts/jquery.autoclear.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('.autoclear').autoclear();
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="grid_20">
        <fieldset>
            <legend>Search </legend>
            <asp:TextBox ID="txtFarmerLastName" runat="server" CssClass="serach-text autoclear"
                Text="Search By Name"></asp:TextBox>
            <asp:TextBox ID="txtCode" runat="server" CssClass="serach-text autoclear" Text="Search By Code"></asp:TextBox>
            <asp:DropDownList ID="ddlStatus" runat="server" CssClass="serach-options">
                <asp:ListItem Text="All" Value="-1"></asp:ListItem>
                <asp:ListItem Text="Satisfactory" Value="0"></asp:ListItem>
                <asp:ListItem Text="Non Satisfactory" Value="1"></asp:ListItem>
            </asp:DropDownList>
            <asp:Button ID="btnSearch" runat="server" Text="Search" CssClass="button small green"
                OnClick="btnSearch_Click" />
            <asp:Button ID="btnReset" runat="server" Text="Reset" CssClass="button small red"
                OnClick="btnReset_Click" />
            <br />
            <br class="clear" />
        </fieldset>
        <asp:GridView ID="grvFarmers" runat="server" SkinID="GridView">
            <Columns>
                <asp:BoundField DataField="FarmerCode" HeaderText="FarmerCode" />
                <asp:BoundField DataField="Name" HeaderText="Name" />
                <asp:BoundField DataField="Address" HeaderText="Address" />
                <asp:TemplateField HeaderText="Remarks">
                    <ItemTemplate>
                        <span class='<%# Eval("Remarks").ToString()=="NotSatisfactory"?"red-mark":"green-mark" %>'>
                            <%# Eval("Remarks") %></span>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <a href="<%= SiteSettings.BaseUrl %>farmer-edit.aspx">Edit</a>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <a href="<%= SiteSettings.BaseUrl %>farmer-tests.aspx">Tests</a>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
</asp:Content>
